package monsmon.game.parse;

import monsmon.game.*;
import monsmon.game.stile.Link_Tile;
import monsmon.game.tmlt.*;

public interface CCmd{

	public void exec(LevelStrs lvl, LevelMap map, MonsGame gd);


	static class Link_Cmd implements CCmd{
		int tx, ty, fx, fy;
		String to_map;
		public Link_Cmd(int fx, int fy, int tx, int ty, String to_map){
			this.tx = tx;
			this.ty = ty;
			this.fx = fx;
			this.fy = fy;
			this.to_map = to_map;
		}
		
		public void exec(LevelStrs lvl, LevelMap map, MonsGame gd){
			map.get_map()[fx][fy] = new Link_Tile(
					map.get_map()[fx][fy], 
					tx, ty,
					to_map);
		}
	}

	static class PutEntC implements CCmd{
		int x, y;
		EntT tmpl;
		PutEntC(EntT t, int x, int y){
			this.x = x;
			this.y = y;
			this.tmpl = t;
		}
		public void exec(LevelStrs lvl, LevelMap map, MonsGame gd){
			new Entity(x, y, map, tmpl);
		}
	}
}
